<extend name="Public/layout"/>
<block name="head">
          <link rel="stylesheet" href="__PUBLIC__assets/layer_mobile/need/layer.css">
          <link rel="stylesheet" href="__PUBLIC__assets/swiper/css/swiper.min.css">
      <link rel="stylesheet" href="__PUBLIC__css/my_circle.css">
          <link rel="stylesheet" href="__PUBLIC__css/dynamic.css">
          <script src="__PUBLIC__assets/swiper/js/swiper.jquery.min.js"></script>
      <script src="__PUBLIC__js/report.js"></script>
<style type="text/css">
.footer{
    display: none !important;
}
</style>
    <script>
        (function (window) {
            var docEl = document.documentElement;
            var h;

            function setUnitA() {
                window.rem = docEl.getBoundingClientRect().width / 10;
                docEl.style.fontSize = window.rem + 'px';
            }

            window.addEventListener('resize', function () {
                clearTimeout(h);
                h = setTimeout(function () {
                    setUnitA();
                }, 300);
            }, false);

            window.addEventListener('pageshow', function (e) {
                if (e.persisted) {
                    clearTimeout(h);
                    h = setTimeout(function () {
                        setUnitA();
                    }, 300);
                }
            }, false);

            setUnitA();

        })(window);
    </script>
    <script src="__PUBLIC__js/util.js"></script>
</block>
<block name="main">
      <div class="content">
                    <div class="my-active">
            <foreach name="r" item="v">
              <if condition="$v.type eq 1 or $v.type eq 2 or $v.type eq 3 or $v.type eq 4">
              
              <!-- 在某平台发表了评论没有添加标签 -->
              <div class="comment-notip clearfix">
                <div class="dy-left">
                  <img src="{$v.user.url_img}">
                </div>
                <div class="dy-right clearfix">
                  <div class="dy-who">
                    <p>{$v.user.nickname}</p>
                  </div>
                  <div class="dy-where">
                    <p>在<a  href="/Home/Circle/circle_info/id/{$v.platform_id}">{$v.platname}圈子</a>发表了平台{$v.tage}</p>
                  </div>
                  <if condition="$v.type eq 1">
                   <notempty name="v.tag.0">
                   <div class="header-bottom clearfix">
                      <ul>
                        <volist name="v.tag" id="vo" offset="0" length='3'>
                          <notempty name="vo">
                        <li>
                          <span>{$vo}</span>
                        </li>
                          </notempty>
                        </volist>
                      </ul>
                    </div>
                    </notempty>
                  </if>
                  <div class="dy-con">
                    <if condition="$v.type eq 1" >
                    <a href="{$v.url}">{$v.evaluate}</a>
                    <elseif condition="$v.type eq 2" />
                     <a href="{$v.url}">{$v.announce}</a>
                    <elseif condition="$v.type eq 3" />
                    <a href="{$v.url}">{$v.content}</a>
                    <elseif condition="$v.type eq 4" />
                    <a href="{$v.url}/platform_id/{$v.platform_id}">{$v.strength}</a>
                    </if>
                  </div>
                  <div class="item-time">
                    <p>{$v.add_time|date="Y-m-d",###}</p>
                  </div>
                  <div class="item-left">

                    <if condition="$v.is_praise eq 0">
                    <div class="item-no" onclick="praise(this,{$v.type},'{$v.id}')">
                      <img src="__PUBLIC__images/comment-no.png" height="26" width="28">
                    <else/>
                    <div class="item-good" onclick="praise(this,{$v.type},'{$v.id}')">
                      <img src="__PUBLIC__images/comment-good.png" height="26" width="28">
                    </if>

                      <span>{$v.praise}</span>
                    </div>
                   <div class="item-com">
                          <span onclick="location.href='{$v.url}'" class="reback">回复</span>
                        </div>
                  </div>
                </div>
              </div>
              <elseif condition="$v.type eq 5 or $v.type eq 6 or $v.type eq 7 or $v.type eq 8"/>
                  <div class="reback clearfix">
                    <div class="dy-left">
                      <img src="{$v.user.url_img}">
                    </div>
                    <div class="dy-right clearfix">
                      <div class="dy-who">
                        <p>{$v.user.nickname} <span>{$v.content}</span></p>
                      </div>
                      
                        <if condition="$v.type_id eq 10 or $v.type_id eq 11 or $v.type_id eq 12 or $v.type_id eq 13">
                      <div class="dy-con">
                        <!-- <p>{$v.comment_count}</p> -->
                        <span onclick="location.href='{$v.url}'" class="reback-detail">{$v.comment_count}</span> 
                      </div>
                        </if>
                      <div class="dy-original clearfix">
                        <div class="dy-where">
                          <p>在<a  href="/Home/Circle/circle_info/id/{$v.info.platform_id}">{$v.info.platname}圈子</a>发表了平台{$v.info.tage}</p>
                        </div>
                        <if condition="$v.type eq 5" >
                         <div class="dy-con">
                          <a  href="{$v.url}">{$v.info.evaluate}</a>
                        </div>
                        <elseif condition="$v.type eq 6" />
                         <div class="dy-con">
                          <a  href="{$v.url}">{$v.info.strength}</a>
                        </div>
                        <elseif condition="$v.type eq 7" />
                         <div class="dy-con">
                          <a  href="{$v.url}">{$v.info.content}</a>
                        </div>
                        <elseif condition="$v.type eq 8" />
                         <div class="dy-con">
                          <a  href="{$v.url}">{$v.info.announce}</a>
                        </div>
                        </if>

                       
                      </div>
          <div class="item-time">
                        <p>{$v.add_time|date="Y-m-d",###}</p>
                    </div>
                       <if condition="$v.type_id eq 10 or $v.type_id eq 11 or $v.type_id eq 12 or $v.type_id eq 13">
                     
                      <div class="item-left">
                      <if condition="$v.is_praise eq 0">
                      <div class="item-no" onclick="comment_praise(this,'{$v.comment_id}')">
                          <img src="__PUBLIC__images/comment-no.png" height="26" width="28">
                      <else/>
                      <div class="item-good" onclick="comment_praise(this,'{$v.comment_id}')">
                          <img src="__PUBLIC__images/comment-good.png" height="26" width="28">
                      </if>

                        
                          <span>{$v.comment_praise}</span>
                        </div>
                       
                         <div class="item-com">
                          <span onclick="location.href='{$v.url}'" class="reback">回复</span>
                        </div>
                      </div>
                       </if>
                    </div>
                  </div>

                <elseif condition="$v.type eq 9 or $v.type eq 10"/>
                   <div class="attention clearfix">
                    <div class="dy-left">
                      <img src="{$v.user.url_img}">
                    </div>
                    <div class="dy-right clearfix">
                      <div class="dy-who">
                        <p>{$v.user.nickname} <span>{$v.content}</span></p>
                      </div>
                      <div class="attention-time">
                        <p>{$v.add_time|date="Y-m-d",###}</p>
                      </div>
                    </div>
                  </div>
              </if>
            </foreach>

      </div>
       <notempty name="r">
      <div class="loading clearfix">
        <span class="loading-left"></span>
        <p>加载中</p>
        <span class="loading-right"></span>
      </div>
      <div class="base-line clearfix">
        <span class="base-left"></span>
        <p>我是有底线的</p>
        <span class="base-right"></span>
      </div>
      </notempty>
      <div style="height: 1.333333rem; width: 100%"></div>
</block>
<block name="js">
  <script type="text/javascript">
          var p = 1;
          var status = 1;
           var is_val = 4;
          $(function(){
            get_more_active(4,1,0,1)
           $(window).scroll(function() {
                if(status==1){
                   if($(document).scrollTop()==$(document).height()-$(window).height()){
                        $('.loading').css('display','block');
                        $('.base-line').css('display','none');
                          get_more_active(is_val,p,1)
                          p = p+1;
                    }
                }
                 
                   
          });
          })
     


 
        
        
        function get_more_active(val,p,ispage,is_change){
          var userid = "{$_SESSION['user']['id']}"
                $.post('/Home/Person/ajax_get_trend/val/1',{
                  userid :userid,
                  is_self:1,
                  val:val,
                  p:p
                },function(res){
        $('.navigation').hide()
        console.log(res)
                  if(res.content==''){
          
                    status==0
                    $('.loading').css('display','none');
                    $('.base-line').css('display','block');
            if(is_change){
            var hh=''
            hh+='<div class="no-item-wrapper" style="display: block;"><div class="no-item"><img src="/App/Home/Public/images/pushercenter-no-item-wrapper.png"><p>暂无内容</p></div></div>'
              $('.my-active').html(hh)
            }
                  }else{
                   if(ispage){
                     $('.my-active').append(res.content)
                    }else{
                      $('.my-active').html(res.content)
                    }
                    
                  }
                 
                })

        }
  function comment_praise(obj,id){
    $.post('{:U("Praise/ajax_praise")}',{
                id:id,
                video_id:id,
                type:3,
            },function(res){
              console.log(res)
               if(res.err==0){
                  $(obj).removeClass('item-no')
                  $(obj).addClass('item-good')
                  $(obj).find('img').attr('src','/App/Home/Public/images/comment-good.png')
                  var num = $(obj).find('span').text()
                  var n =parseInt(num)+1
                  $(obj).find('span').text(n)

               }else if(res.err==2){
                    layer.open({
                      content: res.msg
                      ,skin: 'msg'
                      ,time: 1
                      ,end: function () {
                              location.href = "/Home/User/login?callback=/Home/circle/depth_info/id/{$_GET['id']}/platform_id/{$_GET['platform_id']}"
                            }
                      });
               }else{
                    layer.open({
                      content: res.msg
                      ,skin: 'msg'
                      ,time: 1
                      });
               }
    })
  }
  function praise(obj,type,id){
        var userid = "{$_SESSION['user']['id']}"
         if(!userid){
            layer.open({
                    content: '请先登录！'
                    , skin: 'msg'
                    , time: 1
                    , end: function () {
                        location.href = "/Home/User/login?callback=/Home/circle/commentary_info/id/{$_GET['id']}/platform_id/{$_GET['platform_id']}"
                    }
                });
        }
        if(type==1){
          var postdata = {commentid:id,id:id,type:6}
        }else if(type==2){
          var postdata = {announceid:id,id:id,type:9}
        }else if(type==3){
          var postdata = {opinionid:id,id:id,type:8}
        }else if(type==4){
          var postdata = {depthid:id,id:id,type:7}
        }
        
          $.post('/Home/Praise/ajax_praise',postdata,function(res){
            if(res.err==0){
              $(obj).removeClass('item-no')
              $(obj).addClass('item-good')
              $(obj).find('img').attr('src','/App/Home/Public/images/comment-good.png')
              var num=parseInt($(obj).find('span').text())
              num = num+1
              $(obj).find('span').text(num)
            }else{
              layer.open({
                    content: res.msg
                    , skin: 'msg'
                    , time: 1
                    
              });
            }
          })
        
  }

  function re_report(type,id,plat_id){
      if(type==4) {
        type=2;
      }else if(type==3) {
        type=4;
      }else if(type==2) {
        type=3;
      }
      report(type,id,plat_id)
  }


  </script>
</block>
